package y23.Sep;

class Date {
    public int year;
    public int month;
    public int day;

    public Date() {
        this(1900,1,1);
    }

    public Date(int year, int month, int day) {
        System.out.println("这是一个构造方法");
        this.year = year;
        this.month = month;
        this.day = day;
    }
    public void printDate(){
        System.out.println(this.year+"-"+this.month+"-"+this.day);
    }
}
public class Test {
    public static void main(String[] args) {
        Date d1 = new Date();
        d1.printDate();
    }
}
